
cc.Class({
    extends: cc.Component,

    properties: {
		note:cc.Label,
		itemSprite:cc.Sprite,
		headAtlas:cc.SpriteAtlas,
		_item:'',
    },

    onLoad () {
		cc.director.once('itempanel',(e)=>{
			cc.log('it:e.detail='+e.detail);
			this._item = e.detail;
			if(e.detail == 'xiangshui'){
				this.itemSprite.spriteFrame = this.headAtlas.getSpriteFrame('xiangshui');;
			}else if(this._item == 'xiunv'){
				this.itemSprite.spriteFrame = this.headAtlas.getSpriteFrame('head8');;
			}
		},this);
    },

    OKbtn() {
		if(this._item == 'xiangshui'){
			cc.director.emit('getitem','xiangshui');
		}else if(this._item == 'xiunv'){
			cc.director.emit('getitem','xiunv');
		}
		this.node.active = false;
	},

    // update (dt) {},
});
